CSS Conic Gradients支援度:Can I Use)
如標題直接用conic-gradient
製作圓形進度試試吧~
conic-grdient
製作出圓形底:conic-grdient
的紅色佔的百分比,調整成css變成,由controller控制就完成啦!.circle{
width:300px;
height:300px;
border-radius:50%;
background: conic-gradient(red calc(var(--percentage) * 1%), #ecf0f1 calc(var(--percentage) * 1%));
display:flex;
justify-content:center;
align-items:center;
.overlay{
width:80%;
height:80%;
background:white;
border-radius:50%;
display:flex;
justify-content:center;
align-items:center;
font-size:30px;
font-weight:900;
}
}
IT15-Day26-Create a circular progress bar with CSS! - CSS Conic Gradients